; Set up assigns etc. both for users booting from the CD and from HD
;
; Version 1.1 - Changed jpegtmp
;
; Version 1.2 - Added uninit option
;
; Version 1.3 - Added CHECK argument and link to Prefs editor
Assign CUCD: :
;;; Make some commands resident to speed up things on CD32s in particular
Resident >NIL: CUCD:C/RequestChoice PURE
Resident >NIL: CUCD:rexxc/rx PURE
Resident >NIL: CUCD:C/Version PURE
;;;
;;; Exit if InitCD has been run, otherwise ask
If {arg} EQ "CHECK"
If $CDInit EQ TRUE
Skip END
Else
set init `CUCD:C/RequestChoice "CU Amiga CD" "InitCD needs to be run first*NWould you like to run it now?" "Yes|No"`
If $init EQ 0
Skip END
EndIf
EndIf
EndIf
;;;
;;; Give option to run UninitCD
If $CDInit EQ TRUE
If $CDBoot EQ TRUE ; don't run UninitCD if booted from CD
CUCD:C/RequestChoice >NIL: "CU Amiga CD" "You do not need to run InitCD*Nwhen you have booted from the CD" "OK"
Skip END
EndIf
set remass `CUCD:C/RequestChoice "InitCD" "You have already run InitCD once.*NDo you wish to remove the assigns and paths added before?" "Remove|Cancel"`
If $remass EQ 1
execute UnInitCD
EndIf
Skip END
EndIf
;;;
;;; Set some system assigns and paths
Assign WWW: CUCD:CUCD/WWW
Assign tcpdldir: CUCD:CUCD/WWW
Assign GM: CUCD:CDsupport/GMPlay ADD
Assign CUCDNews: CUCD:CUCD/Online/News
Assign Twist: CUCD:CUCD/Magazine/Issues
Assign TwistIcon: Twist:Icons
Path GM: ADD
;;;
;;; Add MUI if no MUI installed.
Assign MUI: EXISTS >NIL:
IF WARN
Assign MUI: CUCD:CDsupport/MUI
Assign Libs: MUI:Libs ADD
Assign LOCALE: MUI:Locale ADD
Assign HELP: exists >NIL:
If NOT WARN
Dir >NIL: HELP:
EndIf
Assign HELP: MUI:Docs ADD
Else
:C/UpdateCopy >NIL: CUCD:CDsupport/MUI/Libs/MUI/Icon.mcc MUI:Libs/MUI CLONE DEEP
EndIf
;;;
;;; Set assigns and paths for programs on this CD
Execute CUCD:S/ThisCD
;;;
;;;BEGIN ClassAct
CUCD:C/CAPrefs >NIL:
;;;END ClassAct
;;; Start arexx if not running
CUCD:rexxc/rx "address command" >NIL:
If WARN
CUCD:System/RexxMast >NIL:
EndIf
;;;
;;; Commands to be run only if booting from CD
IF $CDBoot EQ TRUE
Run <NIL: >NIL: CUCD:C/NewIcons
CUCD:C/DefIcons
; Run these only if booting from a real CD32
Version >NIL:
if $kickstart EQ "40.60"
;C:CD2XSpeed
C:NoReset
endif
; Allow alternative screenmodes
if $CUCDscreen EQ "NTSC"
:Storage/Monitors/NTSC
:Prefs/ScreenMode from :Prefs/Presets/NTSC USE
:Prefs/Input from :Prefs/Presets/USkey USE
setenv VisageOpts MONITOR=NTSC
endif
if $CUCDscreen EQ "VGA"
:Storage/Monitors/DblPAL
:Prefs/ScreenMode from :Prefs/Presets/VGA USE
setenv VisageOpts MONITOR=DblPAL
endif
unsetenv CUCDscreen
;;;
;;; All this is only needed when not booting from the CD
Else
Run >NIL: RequestChoice "InitCD" "Setting up some assigns and paths to run software from the CD.*NIf you wish to remove the CD from the drive, run InitCD again,*Notherwise the icon will stay on the Workbench." " OK "
; Make environment variables defined on CD available to system
Failat 21
Assign >NIL: ENV: CUCD:Prefs/Env-Archive ADD
; For HappyENV users
If FAIL
Assign >NIL: ENVARC: CUCD:Prefs/Env-Archive ADD
EndIf
;Start NewIcons if not already running
If $NoNewIcons NOT EQ TRUE
CUCD:C/isnirunning
If NOT WARN
Run <NIL: >NIL: CUCD:C/NewIcons
CUCD:C/DefIcons
EndIf
EndIf
; Update workbench paths unless running Directory Opus 5.11 or 5.5 in WBR mode
Version >NIL: C:LoadWB 43
If WARN
C:LoadWB NEWPATH
Else
Version >NIL: C:LoadWB 60
If NOT WARN
C:LoadWB NEWPATH
EndIf
EndIf
; Give option for setting CD preferences
Version >NIL: version 39
If NOT WARN
If NOT EXISTS ENV:IDer.prefs
set edit `RequestChoice "CU Amiga CD" "CUCD now has a preferences program to specify*N the tools used to view/hear different types of files.*NWould you like to run it now?" "Yes|No"`
If $edit EQ 1
cd CUCD:S
:RexxC/MuiRexx CUCDPrefs.mrx port CDPREFS
else
RequestChoice >NIL: "CU Amiga CD" "You can run CUCD preferences at any time.*NIt is in the Prefs drawer of the CD" "OK"